<?php

require_once($_SERVER['DOCUMENT_ROOT'].'/mpd/config/config.php');

$nip= $_GET['NIP'];

$query1=mysql_query("SELECT b.NIP as NIP, b.NAMA as NAMA, b.GENDER as GENDER, b.DOB as DOB, b.POB as POB, b.HEIGHT as HEIGHT, b.WEIGHT as WEIGHT, b.AGAMA as AGAMA, b.ALAMAT as ALAMAT,
						b.KOTA as KOTA, b.TELEPON as TELEPON, b.HANDPHONE as HANDPHONE, s.NAMA_STATUS as NAMA_STATUS, b.TANGGAL_MASUK as TANGGAL_MASUK, b.TANGGAL_TETAP as TANGGAL_TETAP,
						d.NAMA_DEPARTEMEN as DEPARTEMEN FROM biodata as b, status as s, departemen as d where b.ID_STATUS = s.ID_STATUS and d.ID_DEPARTEMEN = b.ID_DEPARTEMEN and  b.NIP =".$nip);  

	while($row = mysql_fetch_array($query1)){
		
		$temp = array(
			'nip' => $nip,
			'nama' => $row['NAMA'],
			'gender' => $row['GENDER'],
			'dob' => $row['DOB'],
			'pob' => $row['POB'],
			'height' => $row['HEIGHT'],
			'weight' => $row['WEIGHT'],
			'agama' => $row['AGAMA'],
			'alamat' => $row['ALAMAT'],
			'kota' => $row['KOTA'],
			'telepon' => $row['TELEPON'],
			'handphone' => $row['HANDPHONE'],
			'status' => $row['NAMA_STATUS'],
			'tanggal_masuk' => $row['TANGGAL_MASUK'],
			'tanggal_tetap' => $row['TANGGAL_TETAP'],
			'departemen' => $row['DEPARTEMEN'],
	
			
			
		);
		}
//baca tabel pendidikan
$query2=mysql_query("SELECT * FROM pendidikan where NIP =".$nip);
//baca tabel core
$query3=mysql_query("SELECT NIP, CORE_COMPETENCE,MAX(TAHUN_CORE) as TAHUN_CORE FROM core where NIP =".$nip);
while($row3 = mysql_fetch_array($query3)){
		
		$temp3 = array(		
			'core_competence' => $row3['CORE_COMPETENCE'],
			't_core' => $row3['TAHUN_CORE'],
		
		);
		
		}
//baca tabel corporate
$query4=mysql_query("SELECT NIP, CORPORATE_TITLE, MAX(TAHUN_CORPORATE) as TAHUN_CORPORATE FROM corporate where NIP =".$nip);
while($row4 = mysql_fetch_array($query4)){
		
		$temp4 = array(		
			'corporate_title' => $row4['CORPORATE_TITLE'],
			't_corp' => $row4['TAHUN_CORPORATE'],
		
		);
		
		}
//baca tabel grade
$query5=mysql_query("SELECT NIP, GRADE, MAX(TANGGAL_GRADE) as TANGGAL_GRADE FROM grade where NIP =".$nip);
while($row5 = mysql_fetch_array($query5)){
		
		$temp5 = array(		
			'grade' => $row5['GRADE'],
			't_grade' => $row5['TANGGAL_GRADE'],
		
		);
		
		}
$query6=mysql_query("SELECT NIP, JOB_GRADE, MAX(TANGGAL_JOB) as TANGGAL_JOB FROM job where NIP =".$nip);
while($row6 = mysql_fetch_array($query6)){
		
		$temp6 = array(		
			'job_grade' => $row6['JOB_GRADE'],
			't_job' => $row6['TANGGAL_JOB'],
		
		);
		
		}
//baca tabel training
$query7=mysql_query("SELECT * FROM training where NIP =".$nip);
//baca tabel performance history
$query8=mysql_query("SELECT * FROM performance_history where NIP =".$nip);
?>